package org.cloud.scheduler.controller;


import java.util.List;
import java.util.Map;
import org.cloud.dimension.annotation.SystemResource;
import org.cloud.scheduler.service.QuartzService;
import org.quartz.Scheduler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/inner/quartz/job/")
@SystemResource(path = "定时任务/quartz")
public class InnerQuartzController {
    @Autowired
    QuartzService quartzService;
    @Autowired
    private Scheduler scheduler;

    @RequestMapping(method = RequestMethod.GET, value = "/all")
    public List<Map<String, Object>> queryAllJob() throws Exception {
        return quartzService.queryAllJob();
    }

    @RequestMapping(method = RequestMethod.GET, value = "/allRunJob")
    public List<Map<String, Object>> queryRunJob() throws Exception {
        return quartzService.queryRunJob();
    }
}
